package cn.wh.test;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Description TODO
 * @Version 1.0.0
 * @Date 2022/11/18 17:20
 * @Created wh
 */
public class VehicalInvacationHandler implements InvocationHandler {

    private final IVehical iVehical;

    public VehicalInvacationHandler(IVehical iVehical) {
        this.iVehical = iVehical;
    }


    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("----before----");
        Object invoke= method.invoke(iVehical,args);
        System.out.println("----after----");
        return invoke;
    }
}
